.mega-sheet .sheet {
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
    padding: 40px 0;
    background: var(--mobile-page-background);
    border-radius: var(--mobile-border-radius-large) var(--mobile-border-radius-large) 0 0;
    transform: translateY(calc(50% + 50vh));
    transition: transform 0.2s ease-out;
    max-height: calc(100% - 16px);
}
.rtl .mega-sheet .sheet {
    direction: rtl;
}
.mobile .mega-sheet .sheet {
    padding-bottom: 16px;
    background: var(--mobile-surface-1);
}

.mega-sheet.with-footer .sheet {
    padding-bottom: 0;
}

.mega-sheet .sheet .header,
.mega-sheet .sheet .main,
.mega-sheet .sheet .actions {
    padding: 0 40px;
    width: 100%;
    box-sizing: border-box;
}
.mega-sheet .sheet .header:empty {
    display: none;
}

body.mobile .mega-sheet .sheet .header,
body.mobile .mega-sheet .sheet .main,
body.mobile .mega-sheet .sheet .actions {
    padding: 0 24px;
}

body.mobile .mega-sheet .overlay-footer {
    padding-left: 24px;
    padding-right: 24px;
}

body.mobile .mega-sheet .sheet .main,
.mega-sheet .sheet > .close {
    margin-bottom: 16px;
}

.mega-sheet .sheet > .actions {
    margin-top: 16px;
}

.mega-sheet.active .sheet {
    transform: translateY(0);
}

.mega-sheet.normal .main {
    align-items: flex-start;
    text-align: start;
}

body.mobile .mega-sheet.normal .sheet .main {
    padding: 0;
}

.mega-sheet.modal-dialog .main {
    align-items: center;
    text-align: center;
}

.mega-sheet.modal-dialog .main > .image {
    margin-left: 0;
    margin-right: 0;
}

.mega-sheet.modal-dialog-left .main {
    align-items: flex-start;
    text-align: start;
}

.mega-sheet i.icon {
    --icon-size: 80px;
}

.mega-sheet i.icon.success {
    color: var(--mobile-support-success);
}

.mega-sheet i.icon.warning {
    color: var(--mobile-support-warning);
}

.mega-sheet i.icon.error {
    color: var(--mobile-support-error);
}

.mega-sheet i.icon.info {
    color: var(--mobile-support-info);
}

.icon.loading {
    animation: rotate 1.5s steps(8, end) infinite;
}

.mega-sheet.full-height .sheet {
    height: calc(100% - 16px);
}

.mega-sheet .actions .button span {
    font-weight: var(--mobile-font-weight-semibold);
}

.mega-sheet .image:empty,
.mega-sheet .header-title:empty
.mega-sheet .title:empty,
.mega-sheet .content:empty,
.mega-sheet .actions:empty {
    display: none;
}

.rtl .mega-sheet .image,
.rtl .mega-sheet .title {
    margin-left: auto;
}

.export-links-dialog .sheet,
.export-links-settings-dialog .sheet,
.link-embed-dialog .sheet {
    background: var(--mobile-page-background);
    border: 1px var(--mobile-border-subtle) solid;
}

.export-links-dialog .sheet .overlay-footer {
    margin-top: 0;
}

body.web-desktop .mega-sheet {
    justify-content: center;
}

body.web-desktop .mega-sheet .sheet {
    width: calc(100% - 16px);
}

body.web-desktop .mega-sheet .sheet,
body.web-desktop .mega-sheet .sheet.ps {
    border-radius: var(--mobile-border-radius-extra-large);
    max-width: 562px;
    min-width: unset;
    max-height: 95%;
    margin: auto;
}

body.web-desktop .mega-sheet.info .sheet {
    background: var(--mobile-page-background);
    border: 1px var(--mobile-border-strong) solid;
    max-width: 640px;
}

body.web-desktop .mega-sheet .sheet .title a,
body.web-desktop .mega-sheet .sheet .content a {
    color: var(--mobile-link-primary);
}

body.web-desktop .mega-sheet .sheet .content a.text-only {
    color: var(--mobile-text-primary);
}

body.web-desktop .mega-sheet .sheet .row-gap-2 {
    row-gap: 0.5rem;
}

body.web-desktop .mega-sheet .overlay-footer {
    margin-top: 24px;
    border-radius: 0 0 var(--mobile-border-radius-large) var(--mobile-border-radius-large);
}

body.web-desktop .mega-sheet.modal-dialog .actions {
    padding: 24px 48px;
    width: 100%;
}

body.web-desktop .mega-sheet.export-links-dialog .sheet,
body.web-desktop .mega-sheet.export-links-settings-dialog .sheet,
body.web-desktop .mega-sheet.link-embed-dialog .sheet,
body.web-desktop .mega-sheet.remove-link-dialog .sheet,
body.web-desktop .mega-sheet.link-settings-discard-dialog .sheet,
body.web-desktop .mega-sheet.discard-dialog .sheet,
body.web-desktop.pwm-ui .mega-sheet.normal.with-footer .sheet,
body.web-desktop .mega-sheet.promo-dialog .sheet,
body.web-desktop .mega-sheet.medium-size .sheet {
    max-width: 640px;
}
body.web-desktop .mega-sheet.overlay-wrap .title h1,
body.web-desktop .mega-sheet.overlay-wrap .title h2 {
    overflow-wrap: anywhere;
    word-break: normal;
}

body.web-desktop .mega-sheet.horizontal-actions .actions {
    flex-direction: row;
    justify-content: end;
}

body.web-desktop .mega-sheet.horizontal-actions .actions button {
    margin-top: 0;
}
body.web-desktop .mega-sheet.horizontal-actions .actions button.slim {
    width: auto;
    height: 36px;
}
body.web-desktop .mega-sheet.horizontal-actions .actions button:not(:first-of-type) {
    margin-inline-start: 16px;
}
body.mobile .mega-sheet .sheet .content .qrcode {
    padding: 16px;
    background-color: rgb(255, 255, 255, 1);
    border-radius: 8px;
    align-self: center;
}
body.mobile .mega-sheet .sheet .content .qrcode canvas {
    display: block;
}
